from urllib.request import urlopen

if __name__ == '__main__':
    url = "https://www.scct.cn"

    resp = urlopen(url=url)

    # 获取服务器状态响应码, int 类型
    print(type(resp.getcode()))
    print(resp.getcode())

    # 获取服务器响应 url
    print(resp.geturl())

    # 获取服务器响应头
    print(type(resp.info()))
    print(resp.info())

    print(resp.getheader("Server"))
    print(resp.getheader("Date"))